
import user.zc.helper.ExcelWriteUtil;
import user.zc.excel.render.ExcelRender;
import user.zc.file.WriteFile;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class ExcelGeneralDemo {

    public static void main(String[] args) {
        List<ExcelData> list = new ArrayList<ExcelData>(){{
            add(new ExcelData("Jack",12,"430921012345678901",58,80,"男",new BigDecimal(12.123)));
            add(new ExcelData("Jack",24,"430921012345678901",58,80,"男",new BigDecimal(12.123)));
            add(new ExcelData("Susan",15,"430921012345678901",60,95,"女",new BigDecimal("34.789")));
            add(new ExcelData("Lucy",20,"430921012345678901",80,95,"女",new BigDecimal(34.789)));
            add(new ExcelData("Lucy",40,"430921012345678901",80,95,"女",new BigDecimal(34.789)));

        }};
        ExcelWriteUtil.builder()
                .create(new ExcelRender(list,"测试sheet页名称"))
                //如果是浏览器输出 outputResource传入 new ResponseFile(HttpServletResponse,String);
                .outputResource(new WriteFile("C:\\Users\\zhouc\\Desktop\\test.xls"))
                .build().general();
    }
}
